package com.ysd.conf;

import com.ysd.util.PropertySlash;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: server_lis
 * @author: liuQi
 * @create: 2023-10-26 15:42
 */
@Configuration
public class WebImgConfig implements WebMvcConfigurer {

    @Value("${picturePath}")
    private String picturePath;
    @Value("${emrFilePath}")
    private String emrFilePath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(PropertySlash.getImagePath()).addResourceLocations("file:" + picturePath + PropertySlash.getSlash());
        registry.addResourceHandler(PropertySlash.getEmrPath()).addResourceLocations("file:" + emrFilePath + PropertySlash.getSlash());
    }
}
